<template lang="html">
    <div class="app-video-page normal-table-page">
        <Card :dis-hover="true">
    		<p slot="title">
    			<Icon type="social-youtube"></Icon> APP首页视频管理
    		</p>
    		<div slot="extra">

    			<!-- <Input v-model="searchKey" class="search-input" icon="search" placeholder="兑换码、兑换人或手机号" style="width: 300px" @keydown.native.enter="doSearch"></Input> -->
    			<Button type="ghost" class="add-new-btn" v-if="searchKey" @click="clearSearch()">清空</Button>

    			<Button type="ghost" class="add-new-btn" icon="plus" @click="showModal = true">新增</Button>
    		</div>
    		<Table :columns="appVideoTableColumns" :loading="pageLoading" ref="appVideoTable" border :data="appVideoList"></Table>

    		<div class="page-ctrl" v-if="pageCount">
    			<Page :total="pageCount" :current="pageNum" show-total show-elevator @on-change="changePage" :page-size="20">
    			</Page>
    		</div>
    	</Card>
    	<Modal :mask-closable="false" v-model="showModal" :title="selectVideo ? '编辑':'新增'" :loading="modalLoading" class-name="redeem-modal" @on-ok="clickOK()">
    		<Form :model="appVideoForm" ref="appVideoForm" :rules="appVideoFormRules">
                <FormItem label="视频标签" prop="homepage_recommend_video_tag_code">
                    <Select v-model="appVideoForm.homepage_recommend_video_tag_code" placement="top" :transfer="true" @on-change="recommendVideoTagChange">
                        <Option value="BUDDHIST_SANGHA">大师共修</Option>
                        <Option value="CONCERT">音乐会</Option>
                        <Option value="CONCERT_REVIEW">音乐会回顾</Option>
                    </Select>
                </FormItem>
                <FormItem label="节目" prop="live_programme_uuid">
                    <Select v-model="appVideoForm.live_programme_uuid" placement="top" :transfer="true" :disabled="allFinishVideoList.length == 0">
                        <Option v-for="programme in allFinishVideoList" :key="programme.uuid" :value="programme.uuid">{{programme.name}}</Option>
                    </Select>
                </FormItem>
                <FormItem label="在APP内显示" prop="isShow">
                    <i-switch v-model="appVideoForm.isShow" ></i-switch>
                </FormItem>
                <FormItem label="展示顺序" prop="orders">
                    <InputNumber v-model="appVideoForm.orders" ></InputNumber>
                    <span style="font-size:12px;color:#999;margin-left:5px;">越大越靠后</span>
                </FormItem>
    		</Form>
    	</Modal>
    </div>
</template>

<script src="./app-video.js">
</script>

<style lang="scss" src="./app-video.scss">
</style>
